package com.dreem.principle.inversion.improve;

/**
 * @program: DesignParrtern
 * @description:
 * @author: Peng
 * @create: 2021-01-15  22:45
 **/
public class DependencyInversionUP {
    public static void main(String[] args){
        new Person().receive(new Email());
    }
}

class Email{
    public String getInfo(){
        return "电子邮件信息为：hello，world！";
    }
}

// 方式2
class Person{
    public void receive(Email email){
        System.out.println(email.getInfo());
    }
}
